package model;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class CatalogueFacture implements Iterable<Facture> {
	private static CatalogueFacture catalogue = null;
	private Set<Facture> factures;
	
	private CatalogueFacture(){
		factures = new HashSet<Facture>();
	}
	
	public static CatalogueFacture getInstance(){
		if (catalogue==null){
			catalogue = new CatalogueFacture();
		}
		return catalogue;
	}
	
	public void add(Facture fact){
		factures.add(fact);
	}
	
	@Override
	public Iterator<Facture> iterator() {
		return factures.iterator();
	}

}
